<template>
	<view class="userInfo pageBg">
		<view :style="{height: getNavBarHeight()+'px'}"></view>
		<view class="Imgtitle">
			<view class="img">
				<image src="@/static/logo.png" mode="aspectFill"></image>
			</view>
			<view class="name">XXX</view>
			<view class="text">坚持记账的第30天</view>
			<view class="text">已经记录111条账单</view>
		</view>
		<view class="nav">
			<view class="item" v-for="item in navList">
				<uni-icons :type="item.icon" size="30" color="#4aab93"></uni-icons>
				<text class="text">{{item.title}}</text>
			</view>
		</view>
		<view class="setting">
			<view>
				<text class="title">数据管理</text>
			</view>
			<view class="item" v-for="item in DataSEeting">
				<view class="left">
					<view>
						<uni-icons :type="item.icon" size="25"></uni-icons>
					</view>
					<view class="text">{{item.title}}</view>
				</view>
				<view class="right">
					<uni-icons type="right" size="20"></uni-icons>
				</view>
			</view>
		</view>
		<view class="setting">
			<view>
				<text class="title">其他</text>
			</view>
			<view class="item" v-for="item in settingList">
				<view class="left">
					<view class="icon">
						<uni-icons :type="item.icon" size="25"></uni-icons>
					</view>
					<view class="text">{{item.title}}</view>
				</view>
				<view class="right">
					<uni-icons type="right" size="20"></uni-icons>
				</view>
			</view>
		</view>

	</view>
</template>

<script setup>
	import { getNavBarHeight } from '@/utils/system.js'
	import { ref } from "vue"
	const navList = ref([
		{ icon: 'auth-filled', title: '自动记账' },
		{ icon: 'calendar-filled', title: '周期记账' },
		{ icon: 'gift-filled', title: '愿望清单' },
		{ icon: 'scan', title: '分类关键词' },
		{ icon: 'wallet-filled', title: '账本管理' },
		{ icon: 'location-filled', title: '标签管理' },
		{ icon: 'settings-filled', title: '分类管理' },
		{ icon: 'gear-filled', title: '更多设置' },
	])
	const settingList = ref([
		{ icon: 'notification', title: '主题外观' },
		{ icon: 'color', title: '桌面小部件' },
		{ icon: 'wallet', title: '使用手册' },
		{ icon: 'personadd', title: '邀请好友' },
		{ icon: 'help', title: '建议与反馈' },
		{ icon: 'star', title: '给应用评分' },
		{ icon: 'chat', title: '关于我们' },
	])
	const DataSEeting = ref([
		{ icon: 'cloud-upload', title: '云同步' },
		{ icon: 'folder-add', title: '数据备份' },
		{ icon: 'cloud-download', title: '导入导出' },
	])
</script>

<style lang="scss" scoped>
	.userInfo {
		padding: 30rpx;
		// padding-bottom: 100rpx;
		height: 100%;
		// background: #f9f9f9;

		.Imgtitle {
			margin-top: 100rpx;
			width: 100%;
			height: 280rpx;
			background: #d8ede6;
			border-radius: 20rpx;
			position: relative;
			display: flex;
			flex-direction: column;
			justify-content: center;
			align-items: center;

			.img {
				position: absolute;
				top: -75rpx;
				left: 50%;
				margin-left: -75rpx;
				width: 150rpx;
				height: 150rpx;
				border-radius: 50%;
				background: #ccc;
				overflow: hidden;
				box-shadow: 0 0 10rpx #00000050;

				image {
					width: 100%;
					height: 100%;
				}
			}

			.name {
				margin-bottom: 10rpx;
				font-size: 38rpx;
				font-weight: 700;
			}

			.text {
				font-size: 26rpx;
				line-height: 36rpx;
			}
		}

		.nav {
			padding: 30rpx 10rpx;
			margin: 30rpx 0;
			background: #fff;
			// height: 250rpx;
			border-radius: 20rpx;
			display: grid;
			grid-template-columns: repeat(4, 1fr);
			gap: 30rpx;

			.item {

				height: 100rpx;
				// border: 1px solid #ccc;
				display: flex;
				flex-direction: column;
				justify-content: space-between;
				align-items: center;

				.text {
					font-size: 24rpx;
					font-weight: 600;
				}
			}
		}

		.setting {
			margin: 30rpx 0;
			background: #fff;
			padding: 30rpx 30rpx 0 30rpx;
			display: flex;
			flex-direction: column;
			border-radius: 20rpx;


			.item {
				margin: 15rpx 0;
				// background: pink;
				display: flex;
				justify-content: space-between;
				padding: 5rpx 0;
				// border-bottom: 1px solid #eee;

				.left {
					display: flex;
					align-items: center;

					.text {
						margin-left: 20rpx;
						font-weight: 600;
						font-size: 28rpx;
					}
				}

				.right {
					display: flex;
					align-items: center;
				}

			}

			.title {
				font-size: 24rpx;
				color: #959595;
			}
		}

	}
</style>